home *** CD-ROM | disk | FTP | other *** search
- *** 1.2 1992/03/27 21:41:42
- --- m68k.c 1992/10/09 15:31:45
- ***************
- *** 56,62 ****
-
- finalize_pic ()
- {
- ! if (flag_pic && current_function_uses_pic_offset_table)
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
- }
-
- --- 56,62 ----
-
- finalize_pic ()
- {
- ! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
- emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
- }
-
- ***************
- *** 204,210 ****
- asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
- #endif
- }
- ! if (flag_pic && current_function_uses_pic_offset_table)
- {
- #ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
- --- 204,210 ----
- asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
- #endif
- }
- ! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
- {
- #ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
- ***************
- *** 794,805 ****
- /* First handle a simple SYMBOL_REF or LABEL_REF */
- if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
- {
- if (reg == 0)
- abort ();
-
- ! pic_ref = gen_rtx (MEM, Pmode,
- ! gen_rtx (PLUS, Pmode,
- ! pic_offset_table_rtx, orig));
- current_function_uses_pic_offset_table = 1;
- RTX_UNCHANGING_P (pic_ref) = 1;
- emit_move_insn (reg, pic_ref);
- --- 794,813 ----
- /* First handle a simple SYMBOL_REF or LABEL_REF */
- if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
- {
- + #ifdef LEGITIMATE_BASEREL_OPERAND_P
- + if (LEGITIMATE_BASEREL_OPERAND_P (orig))
- + return orig;
- + #endif
- +
- if (reg == 0)
- abort ();
-
- ! if (flag_pic == 3)
- ! pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
- ! else
- ! pic_ref = gen_rtx (MEM, Pmode,
- ! gen_rtx (PLUS, Pmode,
- ! pic_offset_table_rtx, orig));
- current_function_uses_pic_offset_table = 1;
- RTX_UNCHANGING_P (pic_ref) = 1;
- emit_move_insn (reg, pic_ref);
- ***************
- *** 831,836 ****
- --- 839,845 ----
- pic_ref = gen_rtx (PLUS, Pmode, base, orig);
- /* Likewise, should we set special REG_NOTEs here? */
- }
- +
- return pic_ref;
- }
-
- ***************
- *** 1593,1598 ****
- --- 1602,1610 ----
- output_address (XEXP (op, 0));
- if (letter == 'd' && ! TARGET_68020
- && CONSTANT_ADDRESS_P (XEXP (op, 0))
- + && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
- + && SYMBOL_REF_FLAG (XEXP (op, 0))
- + && !SYMBOL_REF_USED (XEXP (op, 0)))
- && !(GET_CODE (XEXP (op, 0)) == CONST_INT
- && INTVAL (XEXP (op, 0)) < 0x8000
- && INTVAL (XEXP (op, 0)) >= -0x8000))
- ***************
- *** 1883,1888 ****
- --- 1895,1902 ----
- fprintf (file, ":w");
- if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
- fprintf (file, ":l");
- + if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
- + fprintf (file, ":W");
- }
- fprintf (file, "(%s", reg_names[REGNO (breg)]);
- if (ireg != 0)
- ***************
- *** 1898,1903 ****
- --- 1912,1919 ----
- fprintf (file, ":w");
- if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
- fprintf (file, ":l");
- + if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
- + fprintf (file, ":W");
- }
- if (addr != 0 && ireg != 0)
- {
- ***************
- *** 1975,1980 ****
- --- 1991,2009 ----
- fprintf (file, "%d:w", INTVAL (addr));
- #endif
- }
- + else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
- + && SYMBOL_REF_FLAG (addr)
- + && !SYMBOL_REF_USED (addr))
- + {
- + #ifdef MOTOROLA
- + output_addr_const (file, addr);
- + fputs ("(pc)", file);
- + #else
- + fputs ("pc@(", file);
- + output_addr_const (file, addr);
- + putc (')', file);
- + #endif
- + }
- else
- {
- output_addr_const (file, addr);
- ***************
- *** 1982,1984 ****
- --- 2011,2028 ----
- break;
- }
- }
- + #ifdef ENCODE_SECTION_INFO
- + /* Does operand (which is a symbolic_operand) live in text space? If
- + so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
- +
- + int
- + read_only_operand (operand)
- + rtx operand;
- + {
- + if (GET_CODE (operand) == CONST)
- + operand = XEXP (XEXP (operand, 0), 0);
- + if (GET_CODE (operand) == SYMBOL_REF)
- + return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
- + return 1;
- + }
- + #endif
- *** 1.3 1992/06/11 23:35:03
- --- m68k.h 1992/10/09 15:31:46
- ***************
- *** 91,96 ****
- --- 91,102 ----
- /* Support 68040 fp instructions. */
- #define TARGET_68040_ONLY (target_flags & 01000)
-
- + /* Use PC-relative addressing for refs to read-only data */
- + #define TARGET_PC_REL (target_flags & 02000)
- +
- + /* Use base-relative addressing for refs to data&bss segments */
- + #define TARGET_BASE_REL (target_flags & 04000)
- +
- /* Macro to define tables used to set the flags.
- This is a list in braces of pairs in braces,
- each pair being { "NAME", VALUE }
- ***************
- *** 118,123 ****
- --- 124,133 ----
- { "68030", -01400}, \
- { "68030", 7}, \
- { "68040-only", 01000}, \
- + { "pcrel", 02000}, \
- + { "nopcrel", -02000}, \
- + { "baserel", 04000}, \
- + { "nobaserel", -04000}, \
- { "", TARGET_DEFAULT}}
- /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc. */
-
- ***************
- *** 129,134 ****
- --- 139,145 ----
- if (TARGET_FPA) target_flags &= ~2; \
- if (! TARGET_68020 && flag_pic == 2) \
- error("-fPIC is not currently supported on the 68000 or 68010\n"); \
- + if (TARGET_BASE_REL) flag_pic = 3; \
- }
- #else
- #define OVERRIDE_OPTIONS \
- ***************
- *** 135,140 ****
- --- 146,152 ----
- { \
- if (! TARGET_68020 && flag_pic == 2) \
- error("-fPIC is not currently supported on the 68000 or 68010\n"); \
- + if (TARGET_BASE_REL) flag_pic = 3; \
- }
- #endif /* defined SUPPORT_SUN_FPA */
-
- ***************
- *** 326,334 ****
- #ifndef SUPPORT_SUN_FPA
-
- #define CONDITIONAL_REGISTER_USAGE \
- ! { \
- ! if (flag_pic) \
- ! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
- }
-
- #else /* defined SUPPORT_SUN_FPA */
- --- 338,349 ----
- #ifndef SUPPORT_SUN_FPA
-
- #define CONDITIONAL_REGISTER_USAGE \
- ! { \
- ! if (flag_pic) \
- ! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
- ! /* prevent saving/restoring of the base reg */ \
- ! if (flag_pic == 3) \
- ! call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
- }
-
- #else /* defined SUPPORT_SUN_FPA */
- *** 1.3 1992/06/11 23:35:03
- --- m68k.md 1992/10/09 15:31:46
- ***************
- *** 704,716 ****
- {
- if (flag_pic && symbolic_operand (operands[1], SImode))
- {
- ! /* The source is an address which requires PIC relocation.
- ! Call legitimize_pic_address with the source, mode, and a relocation
- ! register (a new pseudo, or the final destination if reload_in_progress
- ! is set). Then fall through normally */
- ! extern rtx legitimize_pic_address();
- ! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
- ! operands[1] = legitimize_pic_address (operands[1], SImode, temp);
- }
- }")
-
- --- 704,721 ----
- {
- if (flag_pic && symbolic_operand (operands[1], SImode))
- {
- ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
- ! if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
- ! #endif
- ! {
- ! /* The source is an address which requires PIC relocation.
- ! Call legitimize_pic_address with the source, mode, and a relocation
- ! register (a new pseudo, or the final destination if reload_in_progress
- ! is set). Then fall through normally */
- ! extern rtx legitimize_pic_address();
- ! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
- ! operands[1] = legitimize_pic_address (operands[1], SImode, temp);
- ! }
- }
- }")
-
- ***************
- *** 4644,4650 ****
- ""
- "
- {
- ! if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
- operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
- force_reg (Pmode, XEXP (operands[0], 0)));
- }")
- --- 4649,4655 ----
- ""
- "
- {
- ! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
- operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
- force_reg (Pmode, XEXP (operands[0], 0)));
- }")
- ***************
- *** 4655,4661 ****
- (match_operand:SI 1 "general_operand" "g"))]
- ;; Operand 1 not really used on the m68000.
-
- ! "! flag_pic"
- "*
- #ifdef MOTOROLA
- return \"jsr %0\";
- --- 4660,4666 ----
- (match_operand:SI 1 "general_operand" "g"))]
- ;; Operand 1 not really used on the m68000.
-
- ! "(! flag_pic || flag_pic == 3)"
- "*
- #ifdef MOTOROLA
- return \"jsr %0\";
- ***************
- *** 4670,4676 ****
- (match_operand:SI 1 "general_operand" "g"))]
- ;; Operand 1 not really used on the m68000.
-
- ! "flag_pic"
- "*
- return \"jsr %0\";
- ")
- --- 4675,4681 ----
- (match_operand:SI 1 "general_operand" "g"))]
- ;; Operand 1 not really used on the m68000.
-
- ! "(flag_pic && flag_pic < 3)"
- "*
- return \"jsr %0\";
- ")
- ***************
- *** 4686,4692 ****
- ""
- "
- {
- ! if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
- operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
- force_reg (Pmode, XEXP (operands[1], 0)));
- }")
- --- 4691,4697 ----
- ""
- "
- {
- ! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
- operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
- force_reg (Pmode, XEXP (operands[1], 0)));
- }")
- ***************
- *** 4697,4703 ****
- (call (match_operand:QI 1 "memory_operand" "o")
- (match_operand:SI 2 "general_operand" "g")))]
- ;; Operand 2 not really used on the m68000.
- ! "! flag_pic"
- "*
- #ifdef MOTOROLA
- return \"jsr %1\";
- --- 4702,4708 ----
- (call (match_operand:QI 1 "memory_operand" "o")
- (match_operand:SI 2 "general_operand" "g")))]
- ;; Operand 2 not really used on the m68000.
- ! "(! flag_pic || flag_pic == 3)"
- "*
- #ifdef MOTOROLA
- return \"jsr %1\";
- ***************
- *** 4712,4718 ****
- (call (match_operand:QI 1 "memory_operand" "o")
- (match_operand:SI 2 "general_operand" "g")))]
- ;; Operand 2 not really used on the m68000.
- ! "flag_pic"
- "*
- return \"jsr %1\";
- ")
- --- 4717,4723 ----
- (call (match_operand:QI 1 "memory_operand" "o")
- (match_operand:SI 2 "general_operand" "g")))]
- ;; Operand 2 not really used on the m68000.
- ! "(flag_pic && flag_pic < 3)"
- "*
- return \"jsr %1\";
- ")
-